import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:my_flutter/store/Person.dart';
import 'package:provider/provider.dart';

///@ClassName: NoFoundPage
/// @Author: guoyangyang
///@Date: 2022 3/9/22 2:15 PM
///@Description:  404

class NoFoundPage extends StatefulWidget {

  const NoFoundPage({Key? key}) : super(key: key);


  @override
  State<NoFoundPage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<NoFoundPage> {
  int _counter = 0;

  void _incrementCounter() {
    debugPrint('------------build---------');
    Provider.of<Person>(context, listen: false).addAge();
  }

  @override
  Widget build(BuildContext context) {


    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: const Text("NoFoundPage"),
      ),
      body: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: Column(

          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
             Text(
              'age',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}